import fetch from './fetch'

//注册接口
export function regist(data){
    return fetch({
        url:'/users/regist',
        method:'POST',
        data:data
    })
}

//登录接口
export function login(data){
    return fetch({
        url:'/users/login',
        method:'POST',
        data:data
    })
}
//获取商品列表
export function getGoodList(params) {
    return fetch({
      url: '/goods/getGoodList',
      method: 'GET',
      params
    })
}
//富文本文章
export function articleCreate(data) {
    return fetch({
      url: '/goods/create',
      method: 'POST',
      data
    })
  }
//获取商品种类
export function getAllCates(params){
    return fetch({
        url:'/cates/getAllCates',
        method:'GET',
        params
    })
}
//删除商品
export function delGoods(data){
    return fetch({
        url:'./goods/remove',
        method:'POST',
        data
    })
}
export function getAds(params){
    return fetch({
        url:'/ads/list',
        method:'GET',
        params
    })
}
export function createAd(data){
    return fetch({
        url:'./ads/create',
        method:'POST',
        data
    })
}
//获取首页为你推荐的商品列表

// 获取商品详情



export default {
    regist,
    login,
    articleCreate,
    getGoodList,
    getAllCates,
    delGoods,
    createAd
}